<div class="content-wrapper">
    <section class="content-header">
        <h1>发票合同列表</h1>
        <ol class="breadcrumb">
            <li><a href="/"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li class="active">发票合同管理</li>
            <li class="active">发票列表</li>
        </ol>
    </section>
    <section class="content">
        <div class="box">
            <div class="box-header with-border">
                <form class="form-inline" action="/orderBill/orderBillList" method="get">
                    <div class="form-group">
                        <input type="hidden" id="flag" name="flag" value="{$flag}">
                        <label class="label-control" for="type">发票类型 </label>
                        <select id="type" name="type" class="form-control">
                            <option value="0">请选择</option>
                            <foreach name="bill_typeList" item="b_val" key="b_key">
                                <option value="{$b_key}" <if condition="$b_key eq $type">selected</if>>{$b_val}</option>
                            </foreach>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="company_name">公司名 </label>
                        <input type="text" class="form-control" id="company_name" name="company_name" placeholder="客户名称" value="{$company_name}">
                    </div>
                    <div class="form-group">
                        <label for="department">部门 </label>
                        <input type="text" class="form-control" id="department" name="department" placeholder="部门" value="{$department}">
                    </div>
                    <div class="form-group">
                        <label for="admin_name">部门人员 </label>
                        <input type="text" class="form-control" id="admin_name" name="admin_name" placeholder="部门人员" value="{$admin_name}">
                    </div>

                    <button type="submit" class="btn btn-info" id="save-btn">查询</button>
                </form>
            </div>
            <div class="box-body table-responsive">
                <table class="table table-bordered">
                    <tbody>
                    <tr>
                        <th>ID</th>
                        <th>订单ID</th>
                        <th>发票类型</th>
                        <th>公司名称</th>
                        <th>推广产品/游戏</th>
                        <th>产品类型</th>
                        <th>开票金额</th>
                        <th>状态</th>
                        <th>申请时间</th>
                        <th>部门</th>
                        <th>部门人员</th>
                        <th>操作</th>
                    </tr>
                    <if condition="count($billList) eq 0"><tr><td class="text-center" colspan="10">暂无数据...</td></tr></if>
                    <foreach name="billList" item="bill">
                        <tr>
                            <td>{$bill.id}</td>
                            <td>{$bill.order_code}</td>
                            <td>{$bill.type_desc}</td>
                            <td>{$bill.company_title}</td>
                            <td>{$bill.item_name}</td>
                            <td>{$bill.item_type}</td>
                            <td>{$bill.amount}</td>
                            <td><p>{$billStatusList[$bill['status']]}</p>
                                <if condition="$bill.status eq 1 ">
                                    <if condition="$bill.dp_manager_review eq 1 ">
                                        <span class="label label-success">已通过</span>
                                        <else />
                                        <span class="label label-danger">已拒绝</span>
                                    </if>
                                    <elseif condition="$bill.status eq 5 " />
                                    <if condition="$bill.director_review eq 1 ">
                                        <span class="label label-success">已通过</span>
                                        <else />
                                        <span class="label label-danger">已拒绝</span>
                                    </if>
                                    <elseif condition="$bill.status eq 10 " />
                                    <if condition="$bill.g_manager_review eq 1 ">
                                        <span class="label label-success">已通过</span>
                                        <else />
                                        <span class="label label-danger">已拒绝</span>
                                    </if>
                                </if>
                            </td>
                            <td>{$bill['create_time']}</td>
                            <td>{$bill.department_name}</td>
                            <td>{$bill.admin_name}</td>
                            <td>
                                <button class="btn btn-primary btn-xs" type="button" onclick="window.location.href='/OrderBill/uploadOrderBill?id={$bill.id}'">上传</button>&nbsp;
                            </td>
                        </tr>
                    </foreach>
                    </tbody>
                </table>
            </div>
            <div class="box-footer clearfix">{$page_html}</div>
        </div>
    </section>
</div>